<?php
$_GET['keyword'] = empty($_GET['keyword']) ? '' : trim($_GET['keyword']);
$_GET['userid'] = $__userinfo['userid'];

$oComment = new Comment();
$commentlist = $oComment->get_list('*', $_GET, array('id' => 'DESC'), $__page, $__pagesize);
if(!empty($commentlist)){
	foreach($commentlist['list'] as $key => $row){
		if(empty($row['goodsinfo']['filename'])){
			$row['goodsinfo']['url'] = PUB_DIR.'goods/'.time_to_path($row['goodsinfo']['addtime']).'/'.$row['goodsinfo']['id'].'.html';
		}else{
			$row['goodsinfo']['url'] = PUB_DIR.'goods/'.$row['goodsinfo']['filename'].'.html';
		}
		$row['addtime'] = ftime($row['addtime']);

		// 高亮关键词
		//if(!empty($_GET['keyword'])){
			$row['_hl_sn'] = highlight_word($row['sn'], $_GET['keyword']);
			$row['_hl_content'] = highlight_word($row['content'], $_GET['keyword']);
		//} 
		
		$commentlist['list'][$key] = $row;
	}
	$vars['list']	= $commentlist['list'];
	$vars['pagelist']		= $commentlist['pagelist'];
}
//print_r($commentlist);
?>